package com.wgworkshop.pems.model;

import com.wgworkshop.pems.checkgroup.CreateCheckGroup;
import com.wgworkshop.pems.checkgroup.PatchCheckGroup;
import com.wgworkshop.pems.checkgroup.UpdateCheckGroup;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.Date;

/**
 * 考勤模型。
 * Created by wlc on 2017/7/9.
 */
public class AttendanceModel {
    @Null(message = "考勤ID只能为null。",
            groups = {CreateCheckGroup.class, PatchCheckGroup.class})
    @NotNull(message = "考勤ID不能为null。",
            groups = UpdateCheckGroup.class)
    @Min(value = 1,
            message = "不正确的考勤ID[${validatedValue}]。",
            groups = UpdateCheckGroup.class)
    private Long id;

    @NotNull(message = "学生ID不能为null。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class})
    @Min(value = 1,
            message = "不正确的学生ID[${validatedValue}]。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private Long studentId;

    @NotNull(message = "课程日期不能为null。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class})
    private Date courseDate;

    @NotNull(message = "操作日期不能为null。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class})
    private Date operateDate;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getStudentId() {
        return studentId;
    }

    public void setStudentId(Long studentId) {
        this.studentId = studentId;
    }

    public Date getCourseDate() {
        return courseDate;
    }

    public void setCourseDate(Date courseDate) {
        this.courseDate = courseDate;
    }

    public Date getOperateDate() {
        return operateDate;
    }

    public void setOperateDate(Date operateDate) {
        this.operateDate = operateDate;
    }
}
